/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.androidpublisher.model;

/**
 * A single one-time product for an app.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Google Play Android Developer API. For a detailed
 * explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class OneTimeProduct extends com.google.api.client.json.GenericJson {

  /**
   * Required. Set of localized title and description data. Must not have duplicate entries with the
   * same language_code.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<OneTimeProductListing> listings;

  /**
   * Optional. List of up to 20 custom tags specified for this one-time product, and returned to the
   * app through the billing library. Purchase options and offers for this product will also receive
   * these tags in the billing library.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<OfferTag> offerTags;

  static {
    // hack to force ProGuard to consider OfferTag used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(OfferTag.class);
  }

  /**
   * Required. Immutable. Package name of the parent app.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String packageName;

  /**
   * Required. Immutable. Unique product ID of the product. Unique within the parent app. Product
   * IDs must start with a number or lowercase letter, and can contain numbers (0-9), lowercase
   * letters (a-z), underscores (_), and periods (.).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String productId;

  /**
   * Required. The set of purchase options for this one-time product.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<OneTimeProductPurchaseOption> purchaseOptions;

  /**
   * Output only. The version of the regions configuration that was used to generate the one-time
   * product.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private RegionsVersion regionsVersion;

  /**
   * Optional. Countries where the purchase of this one-time product is restricted to payment
   * methods registered in the same country. If empty, no payment location restrictions are imposed.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private RestrictedPaymentCountries restrictedPaymentCountries;

  /**
   * Details about taxes and legal compliance.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private OneTimeProductTaxAndComplianceSettings taxAndComplianceSettings;

  /**
   * Required. Set of localized title and description data. Must not have duplicate entries with the
   * same language_code.
   * @return value or {@code null} for none
   */
  public java.util.List<OneTimeProductListing> getListings() {
    return listings;
  }

  /**
   * Required. Set of localized title and description data. Must not have duplicate entries with the
   * same language_code.
   * @param listings listings or {@code null} for none
   */
  public OneTimeProduct setListings(java.util.List<OneTimeProductListing> listings) {
    this.listings = listings;
    return this;
  }

  /**
   * Optional. List of up to 20 custom tags specified for this one-time product, and returned to the
   * app through the billing library. Purchase options and offers for this product will also receive
   * these tags in the billing library.
   * @return value or {@code null} for none
   */
  public java.util.List<OfferTag> getOfferTags() {
    return offerTags;
  }

  /**
   * Optional. List of up to 20 custom tags specified for this one-time product, and returned to the
   * app through the billing library. Purchase options and offers for this product will also receive
   * these tags in the billing library.
   * @param offerTags offerTags or {@code null} for none
   */
  public OneTimeProduct setOfferTags(java.util.List<OfferTag> offerTags) {
    this.offerTags = offerTags;
    return this;
  }

  /**
   * Required. Immutable. Package name of the parent app.
   * @return value or {@code null} for none
   */
  public java.lang.String getPackageName() {
    return packageName;
  }

  /**
   * Required. Immutable. Package name of the parent app.
   * @param packageName packageName or {@code null} for none
   */
  public OneTimeProduct setPackageName(java.lang.String packageName) {
    this.packageName = packageName;
    return this;
  }

  /**
   * Required. Immutable. Unique product ID of the product. Unique within the parent app. Product
   * IDs must start with a number or lowercase letter, and can contain numbers (0-9), lowercase
   * letters (a-z), underscores (_), and periods (.).
   * @return value or {@code null} for none
   */
  public java.lang.String getProductId() {
    return productId;
  }

  /**
   * Required. Immutable. Unique product ID of the product. Unique within the parent app. Product
   * IDs must start with a number or lowercase letter, and can contain numbers (0-9), lowercase
   * letters (a-z), underscores (_), and periods (.).
   * @param productId productId or {@code null} for none
   */
  public OneTimeProduct setProductId(java.lang.String productId) {
    this.productId = productId;
    return this;
  }

  /**
   * Required. The set of purchase options for this one-time product.
   * @return value or {@code null} for none
   */
  public java.util.List<OneTimeProductPurchaseOption> getPurchaseOptions() {
    return purchaseOptions;
  }

  /**
   * Required. The set of purchase options for this one-time product.
   * @param purchaseOptions purchaseOptions or {@code null} for none
   */
  public OneTimeProduct setPurchaseOptions(java.util.List<OneTimeProductPurchaseOption> purchaseOptions) {
    this.purchaseOptions = purchaseOptions;
    return this;
  }

  /**
   * Output only. The version of the regions configuration that was used to generate the one-time
   * product.
   * @return value or {@code null} for none
   */
  public RegionsVersion getRegionsVersion() {
    return regionsVersion;
  }

  /**
   * Output only. The version of the regions configuration that was used to generate the one-time
   * product.
   * @param regionsVersion regionsVersion or {@code null} for none
   */
  public OneTimeProduct setRegionsVersion(RegionsVersion regionsVersion) {
    this.regionsVersion = regionsVersion;
    return this;
  }

  /**
   * Optional. Countries where the purchase of this one-time product is restricted to payment
   * methods registered in the same country. If empty, no payment location restrictions are imposed.
   * @return value or {@code null} for none
   */
  public RestrictedPaymentCountries getRestrictedPaymentCountries() {
    return restrictedPaymentCountries;
  }

  /**
   * Optional. Countries where the purchase of this one-time product is restricted to payment
   * methods registered in the same country. If empty, no payment location restrictions are imposed.
   * @param restrictedPaymentCountries restrictedPaymentCountries or {@code null} for none
   */
  public OneTimeProduct setRestrictedPaymentCountries(RestrictedPaymentCountries restrictedPaymentCountries) {
    this.restrictedPaymentCountries = restrictedPaymentCountries;
    return this;
  }

  /**
   * Details about taxes and legal compliance.
   * @return value or {@code null} for none
   */
  public OneTimeProductTaxAndComplianceSettings getTaxAndComplianceSettings() {
    return taxAndComplianceSettings;
  }

  /**
   * Details about taxes and legal compliance.
   * @param taxAndComplianceSettings taxAndComplianceSettings or {@code null} for none
   */
  public OneTimeProduct setTaxAndComplianceSettings(OneTimeProductTaxAndComplianceSettings taxAndComplianceSettings) {
    this.taxAndComplianceSettings = taxAndComplianceSettings;
    return this;
  }

  @Override
  public OneTimeProduct set(String fieldName, Object value) {
    return (OneTimeProduct) super.set(fieldName, value);
  }

  @Override
  public OneTimeProduct clone() {
    return (OneTimeProduct) super.clone();
  }

}
